<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04_DOM操作</title>
</head>
<body>
    <button onclick="addMoney()">点我变富有</button>
    <hr>
<!--    <img src="img/money.jpg" width="200"-->
    <script>
        function addMoney(){
            let imgE = document.createElement('img');//<img>
            imgE.src = 'img/money.jpg';//<img src="">
            imgE.width = 200;//<img src="" width="">
            let bodyE = document.querySelector('body');//找到body元素
            bodyE.append(imgE);//将上面创建好的img元素追加到body元素之后
        }
    </script>
</body>
</html>